package com.g2.admin.service;

import com.g2.admin.model.po.AuthPermitRolePo;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import com.g2.admin.model.po.AuthRoleUserPo;
import com.g2.admin.dao.mapper.IAuthRoleUserMapper;

import java.util.List;

@Service
@Slf4j
public class AuthRoleUserService {
    @Autowired
    private IAuthRoleUserMapper userroleMapper;

    public AuthRoleUserPo getUserrole(long id) {
        return userroleMapper.selectById(id);
    }

    public void delUserrole(long id) {
        userroleMapper.deleteById(id);
    }

    public void addUserrole(AuthRoleUserPo userrole) {
        userroleMapper.insert(userrole);
    }

    public void updateUserrole(AuthRoleUserPo userrole) {
        userroleMapper.updateById(userrole);
    }

    public List<String> getUserRoleAuths(long userId) {
        return userroleMapper.selectUserRoleAuths(userId);
    }
}
